package ms.maplestory.boot.connection.opcode;

import java.util.Arrays;
import java.util.List;

public enum OutHeader {

    LP_CheckPasswordResult(0),
    LP_GuestIDLoginResult(1), // 未使用
    LP_AccountInfoResult(2), // 未使用
    LP_CheckUserLimitResult(3),
    LP_CheckPinCodeResult(6),
    LP_UpdatePinCodeResult(7),
    LP_ViewAllCharResult(8),
    LP_WorldInformation(10),
    LP_SelectWorldResult(11),
    LP_SelectCharacterResult(12),
    LP_CheckDuplicatedIDResult(13),
    LP_CreateNewCharacterResult(14),
    LP_EnableSPWResult(21),
    LP_LatestConnectedWorld(24),
    LP_RecommendWorldMessage(25),
    LP_SetField(141);

    private short opcode;

    OutHeader(int opcode) {
        this.opcode = (short) opcode;
    }

    public short getOpcode() {
        return opcode;
    }

    public static OutHeader getOutHeaderByOp(int op) {
        for (OutHeader outHeader : OutHeader.values()) {
            if (outHeader.getOpcode() == op) {
                return outHeader;
            }
        }
        return null;
    }

    private static List<OutHeader> spam = Arrays.asList(
    );

    public static boolean isSpamHeader(OutHeader outHeader) {
        return spam.contains(outHeader);
    }
}